home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 3
/
003.d81
/
guess what
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
114 lines
1 df$="guess.data"
5 z$=chr$(34)
10 rem the game of animal
20 dim a$(4,400)
25 close8:close15:close2
30 rem init initial conditions
35 gosub 1500
40 gosub 9000
50 i=2
100 if a$(1,i)="t" then print "is it ";
105 print a$(4,i);
110 input q$:if q$="?" then gosub 2500
115 if q$="e" then gosub 1000
120 q$=left$(q$,1):if q$<>"y" and q$<>"n" then 100
130 if a$(1,i) <>"q" then 500:rem terminal
140 if q$="y" then oq=2:oi=i:i=val(a$(2,i)):goto 100
150 if q$="n" then oq=3:oi=i:i=val(a$(3,i)):goto 100
160 print "error":stop
500 if q$="n" then 600
510 print "i guessed it!!!"
520 input "try again";q$:if q$="?" then gosub 2500
530 q$=left$(q$,1):if q$<>"y" and q$<>"n" then 520
540 if q$="y"then i=2:print: goto 100
550 print "i had fun, hope you did"
552 goto63000
600 rem learn something new
620 print "well i am out of ideas..."
630 input "you were thiniking of";o$
640 print "to tell [152]"o$"[146][154]"
645 print"from [152]"a$(4,i)"[146][154]"
650 input "you would ask";a$
660 print "for [152]"o$"[146][154] the answer is "
665 input q$
670 q$=left$(q$,1):if q$<>"y"andq$<>"n" then 660
675 print"[152]please hang on while i remember this[146][154]"
680 a$(oq,oi)=str$(mi):a$(1,mi)="q":a$(4,mi)=a$
690 t1=3:t2=2:if q$="n" then t1=2:t2=3
700 a$(t1,mi)=str$(i):a$(t2,mi)=str$(mi+1)
710 mi=mi+1:a$(1,mi)="t":a$(2,mi)="":a$(3,mi)="":a$(4,mi)=o$:mi=mi+1
715 a$(1,1)=str$(mi)
720 open15,8,15:open8,8,8,df$
730 r=oi:gosub 5000:r=mi-1:gosub 5000:r=mi-2:gosub 5000:r=1:gosub5000
740 close8:close15
800 i=2:gosub2000:goto 520
999 goto63000
1000 print "[147][152] edit data --- be carefull!!! [146][154]"
1010 input "hardcopy list";qq$
1020 if qq$="y" then gosub 2010
1030 input "record";r:if r=0 then return
1040 for ii=1to4
1050 print " "a$(ii,r)
1060 input "[145]";a$(ii,r)
1080 next
1090 input "update";qq$:if qq$<>"y" then 1030
1100 open15,8,15:open8,8,8,df$
1110 gosub 5000
1120 close8:close15
1130 goto 1030
1500 print "[147][152] the game of animal [146][154]"
1510 print"answer my questions with yes or no and"
1520 print "i will guess what you are thinking about"
1530 print"if you stump me i'll remember so it"
1540 print"won't happen again"
1550 print"please wait while i refresh my memory"
1560 print""
1570 return
2000 return
2010 open2,4
2020 print#2:print#2:print#2,"animal database"
2030 for ii=1 to mi-1
2040 print#2,ii"type="a$(1,ii)" yes#"a$(2,ii)" no#"a$(3,ii)" thing: "a$(4,ii)
2050 next
2060 print#2:close2
2070 return
2500 print "[147][152]the things i know about are:[146][154]"
2510 for ii=1 to mi-1
2520 if a$(1,ii)="t" then print a$(4,ii)
2530 next
2540 return
5000 print#15,"p"chr$(8)chr$(rand255)chr$(r/256)chr$(0)
5006 input#15,en,em$,et,es:qn=en
5007 if en=50 then print#8,1:goto5000
5010 ol$=z$+a$(1,r)+z$+","+z$+a$(2,r)+z$+","+z$+a$(3,r)+z$+","+z$+a$(4,r)+z$
5012 print#8,ol$
5013 rem print len(ol$)":::"ol$
5015 input#15,en,em$,et,es:if en<>0thenstop
5030 return
9000 i=0
9002 open15,8,15:open8,8,8,df$:input#15,en,em$,et,es:ifen<>0thengoto9200
9005 i=i+1
9006 if i=val(a$(1,1))then mi=i:gosub2000:close8:close15:return
9007 print#15,"p"chr$(8)chr$(iand255)chr$(i/256)chr$(0)
9009 if en=50 or i=val(a$(1,1))then mi=i:gosub2000:close8:close15: return
9010 input#8,a$(1,i),a$(2,i),a$(3,i),a$(4,i)
9020 goto 9005
9200 close8:close15
9210 i=1
9220 i=i+1
9230 reada$(1,i),a$(2,i),a$(3,i),a$(4,i)
9240 if a$(1,i)<>"" then 9220
9245 mi=i:a$(1,1)=str$(mi)
9250 open15,8,15:open8,8,8,df$+",l,"+chr$(80)
9260 for r=1 to mi-1
9270 gosub5000
9290 next r
9300 close8:close15:gosub2000:return
9500 data "q","3","4","is it alive"
9510 data "t","","","a frog"
9520 data "t","","","a desk"
9530 data "","","",""
63000 forc0=1to1000:next:print"[147]"
63005 print"load"chr$(34)"payload"chr$(34)",8":print"run"
63010 poke631,13:poke632,13:poke198,2:end